-
Notifications
You must be signed in to change notification settings - Fork 83
Minizinc does not handle empty arguments well #924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Are you using Windows? I think this is actually this bug in PowerShell PowerShell/PowerShell#6280. The workaround (over than upgrading to PowerShell 7.3 or using any other OS) is to run with I'm going to close this now as I don't think this is a bug in MiniZinc, but if you're running into this on a different operating system, please reopen this issue. |
I use Linux Mint latest version. I cannot find any issue on internet with the command line in a the terminal. I also installed Xterm and tried it there. Results are the same. I tried a shell command file and $# (number of arguments) shows then "" is seen as an argument. |
I haven't been able to reproduce this problem on Ubuntu 24.04 (which I think should behave the same as Linux Mint). Which method did you use to install MiniZinc? |
Put distribution in some directory, Define alias for minizinc and minizincIDE. |
Is the issue still present when you directly call the |
How did you define the alias? Did you put |
I can repro if I incorrectly set the alias like this If this is the case, the cause of the issue is how the shell handles quotes, not |
I would probably advice against setting an alias like this, unless you have a very, very good reason for it |
When not using an alias then I get this error, only for the solver cp-sat. |
This error due to a problem with the dynamic linking of the OR-Tools CP-SAT. CP-SAT uses an external dependency, abseil, and it needs to dynamically link the binary during runtime, but it fails to find in the usual places it's looking for it. I'm not sure how aliasing the command solves this, you didn't share how you alias. You should be able to fix it by either modifying and exporting the |
The point is when I define LD_LIBRARY_PATH as described in the manual, nothing else works like mc or gedit. |
To test the initial problem with the empty arguments, could you run a solver that doesn't require any shared libraries (e.g. For me, this is what I tried: wget https://github.com/MiniZinc/MiniZincIDE/releases/download/2.9.3/MiniZincIDE-2.9.3-bundle-linux-x86_64.tgz
tar -xvf MiniZincIDE-2.9.3-bundle-linux-x86_64.tgz
echo "var 1..3: x;" > test.mzn
./MiniZincIDE-2.9.3-bundle-linux-x86_64/bin/minizinc --solver chuffed -a --soln-sep "" --search-complete-msg "" test.mzn And I got the expected result
|
Uh oh!
There was an error while loading. Please reload this page.
When I define my own separators everything is fine, but when I define an empty argument it seems to be skipped. In the past it worked fine. previous scripts which worked fine, now give different results. See the next example.
`$minizinc -a -n 2 2.mzn --soln-sep "%%%%%%%%%%%%%%%%%%%%%%%%%%%" --search-complete-msg "&&&&&&&&&&&&&&&&&&&&"
3 = 1 + 2
%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 = 1 + 3
%%%%%%%%%%%%%%%%%%%%%%%%%%%
$ minizinc -a -n 2 2.mzn --soln-sep "" --search-complete-msg ""
3 = 1 + 2
--search-complete-msg
4 = 1 + 3
--search-complete-msg`
The text was updated successfully, but these errors were encountered: